The present invention relates to image processing devices and image processing methods, and in particular, to an image processing device and an image processing method for performing correction of a facial image.
When an image such as a photograph, a video, or the like includes a person's face, the face in the image is often the portion that attracts the attention of a person observing the image. A technique for correcting or adjusting the facial image to improve the appearance of the face included in the image is conventionally known.
For example, patent document 1 (Japanese Unexamined Patent Publication No. 2009-231879, published Oct. 8, 2009) discloses a technique of extracting contours of the upper and lower lips, identifying the portion surrounded by the detected contours on the inner side of the upper and lower lips as the portion corresponding to the teeth, and adjusting the brightness of the portion corresponding to the teeth. For example, the pixel values of the portion corresponding to the teeth are made light to improve the appearance of the face. In the technique of patent document 1, the contour of the lip is detected from the change in the luminance value of each pixel of the image to identify the portion corresponding to the teeth. Specifically, a plurality of detection lines in a vertical direction (height direction of the face) is defined in the mouth region, the change in the luminance value of the pixel is examined along each detection line, and the point where the change in the luminance value is relatively large is identified as the contour point of the lip. The contour points corresponding to the contour on the outer side and the contour on the inner side of the upper and lower lips are identified from a spatial distribution of the identified contour points, the region surrounded by the contour on the inner side of the upper and lower lips is identified as the inside of the mouth, and the region corresponding to the teeth is assumed to exist thereat. If a histogram for the luminance values in the region inside the mouth is created, many hills appear. According to patent document 1, the pixel having a luminance greater than a local minimal value of the histogram closest to the maximum luminance value is assumed as the tooth.
However, the conventional configuration described above has the following problems.
Consideration is made to first detect the contour of the lip to identify the region to correct the lip or the teeth. However, a facial image with satisfactory illumination condition needs to be prepared to detect the contour of the lip using the technique of patent document 1. The luminance value of the image greatly changes depending on the photographing environment such as illumination, and the like. For example, in the facial image photographed under a backlight condition, the light does not shine on the portion of the face and the entire face becomes dark. Thus, the change in the luminance value for every pixel becomes small, the change in the luminance value of the contour portion of the lip also becomes small, and a problem that the identification of the contour point becomes difficult (erroneous detection tends to easily occur) arises. Furthermore, when photographed under low illumination intensity such as indoor and the like, the noise becomes relatively large and the identification of the contour point of the lip becomes more difficult.
When photographed under the illumination condition in which light shines on the face, the change in the luminance value of the contour portion of the lip becomes large and the contour point can be easily identified. However, shadow may form by the bumps of the face depending on the manner the light shines on the face, where change in luminance greater than the change in the luminance value at the contour of the lip may occur at the boundary portion of the shadow. As a result, distinction between the boundary of the shadow and the contour of the lip becomes difficult.
When photographed under the illumination condition in which light strongly shines on the face, the entire face appears whitish (luminance is large). Thus, the vicinity of the contour of the lip becomes whitish, the change in the luminance value of the contour portion becomes small, and the identification of the contour point becomes difficult. If a great change in luminance occurs at the boundary of the shiny region due to the reflection (shine) of the light hitting the lipstick or lip gloss, the distinction between the contour and the boundary of the shine becomes difficult and erroneous detection tends to easily occur.
In the technique of patent document 1, the pixel, whose luminance is greater than a certain value in the oral region identified from the contour of the lip, is identified as the correction target, and tone curve is uniformly applied on the pixel to be corrected to increase the luminance. In this case, the boundary of the region determined as the correction target and the other regions may appear unnaturally emphasized due to the correction of increasing the luminance.
In light of the foregoing, it is an object of at least one embodiment of the present invention to realize image processing for appropriately performing the correction on the organ to be processed such that the boundary of the region to be processed is not unnaturally emphasized.